<template>
  <div>
    <template>
      <el-table
          height="400"
          :data="tableData"
          stripe
          style="width: 100%">

        <el-table-column prop="classFee" label="姓名" width="180">
        </el-table-column>
        <el-table-column prop="subjectName" label="科目名称">
        </el-table-column>
        <el-table-column prop="studentName" label="学生名称">
        </el-table-column>
        <el-table-column prop="classDate" label="上课日期">
        </el-table-column>
        <el-table-column prop="beginTime" label="开始时间" width="180">
        </el-table-column>
        <el-table-column prop="endTime" label="结束时间">
        </el-table-column>
      </el-table>
    </template>
    <div>
      <el-pagination
          background
          :page-count="count"
          :page-size="pageSize"
          :current-page="pageCurrent"
          @current-change="pageChange"
          layout="prev, pager, next"
          :total="total">
      </el-pagination>
    </div>

  </div>
</template>

<script>
export default {
  name: "FinishStudents",
  data() {
    return {
      tableData: [],
      id:null,
      pageSize:5,
      count:5,
      total:100,
      pageCurrent:1,
    }
  },
  methods: {
    pageChange(page){
      this.pageCurrent = page;
      this.getClassPage();
      console.log(page)
    },
    getClassPage() {
      this.id = localStorage.getItem("id")
      this.$http.post("teacher/getFinishClassPage?userId="+this.id+"&pageCurrent="+
          this.pageCurrent+"&pageSize="+this.pageSize).then(res=>{
        console.log(res)
        this.tableData=res.data.result.teachers.records;
        this.total = res.data.result.teachers.total;
      })
    }
  },
  mounted() {
    this.getClassPage()
  }
}
</script>

<style scoped>
.el-pagination{
  float: right;
}

</style>